import 'package:intl/intl.dart';

class DateUtils {
  static String format(DateTime date) {
    if (!isToday(date)) return DateFormat.yMd("zh").format(date);
    return DateFormat.Hms("zh").format(date);
  }

  static bool isToday(DateTime date) {
    var now = DateTime.now();
    return now.year == date.year &&
        now.month == date.month &&
        now.day == date.day;
  }
}
